package com.xtianzhuang.www.utils;

import java.util.List;

import com.xtianzhuang.www.entity.response.base.BaseResponse;

public class PageData<E> extends BaseResponse {
	private static final long serialVersionUID = 1L;

	private long total;
	private int currPage = 1;
	private int pageSize = 10;
	private List<E> data;

	public PageData() {
	}


	public long getTotal() {
		return this.total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getCurrPage() {
		return this.currPage;
	}

	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}

	public int getPageSize() {
		return this.pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}


	public List<E> getData() {
		return data;
	}


	public void setData(List<E> data) {
		this.data = data;
	}

	public long getTotalPages() {
		return this.getTotal() % this.getPageSize() == 0L ? this.getTotal() / this.getPageSize()
				: this.getTotal() / this.getPageSize() + 1L;
	}


}
